ResrvMem
ResrvMem
Create free space at lowest position in heap Size bytesNeeded ; desired size of block to reserve ResrvMem compacts the heap, moving blocks to the top of the heap, and growing it if necessary. It is used in preparation for allocating a relocatable
block that you know will be locked for a long time.
bytesNeeded is the amount of memory that you wish to reserve in the lowest part
of the current heap zone. As a Size type, it should be less than 16M (a 24-bit value).
memFullErr (-108) Not enough room in heap
Notes: There is another routine, ReserveMemSysResrvMem, which performs
the equivalent operation to ResrvMem, but in the System heap zone. It relocatable block low in the heap where it will cause the least interference
with subsequent heap compaction. It is only needed if you expect to allocate a
relocatable, but locked block (e.g., a code segment).
There is no need to use this function for nonrelocatable blocks (i.e.,
NewPtr calls or for loading resources), since they are automatically allocated from the lowest part of the heap.